#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "ActivityGroup.h"
#include "NamedElement.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class ActivityEdge;
class ActivityNode;

/// <summary>
/// InterruptibleActivityRegion
/// An InterruptibleActivityRegion is an ActivityGroup that supports the termination
/// of tokens flowing in the portions of an activity within it.
/// </summary>
class UMLMODEL_EXPORT InterruptibleActivityRegion : public NamedElement, public ActivityGroup {

public: // Constructors and destructors
    explicit InterruptibleActivityRegion(const QString& umlType="uml::InterruptibleActivityRegion");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// interruptingEdges getter
    /// The ActivityEdges leaving the InterruptibleActivityRegion on which a traversing
    /// token will result in the termination of other tokens flowing in the
    /// InterruptibleActivityRegion.
    /// </summary>
    vector<shared_ptr<ActivityEdge>>& interruptingEdges();

    /// <summary>
    /// nodes getter
    /// ActivityNodes immediately contained in the InterruptibleActivityRegion.
    /// </summary>
    vector<shared_ptr<ActivityNode>>& nodes();

private: // Fields
    /// <summary>
    /// interruptingEdges
    /// The ActivityEdges leaving the InterruptibleActivityRegion on which a traversing
    /// token will result in the termination of other tokens flowing in the
    /// InterruptibleActivityRegion.
    /// </summary>
    vector<shared_ptr<ActivityEdge>> interruptingEdges_;

    /// <summary>
    /// nodes
    /// ActivityNodes immediately contained in the InterruptibleActivityRegion.
    /// </summary>
    vector<shared_ptr<ActivityNode>> nodes_;

};

} // namespace uml
